﻿using System;
using System.Text.RegularExpressions;

namespace WeiSha.Core
{
	// Token: 0x02000018 RID: 24
	public class HTML
	{
		// Token: 0x0600008F RID: 143 RVA: 0x000050B0 File Offset: 0x000032B0
		public static string ClearTag(string html, int length = 0)
		{
			bool flag = string.IsNullOrWhiteSpace(html);
			string text;
			if (flag)
			{
				text = html;
			}
			else
			{
				string text2 = Regex.Replace(html, "<[^>]+>", "");
				text2 = Regex.Replace(text2, "&[^;]+;", "");
				bool flag2 = length > 0 && text2.Length > length;
				if (flag2)
				{
					text = text2.Substring(0, length);
				}
				else
				{
					text = text2;
				}
			}
			return text;
		}
	}
}
